<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$Think.lang.commission}</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="INDEX/css/mui.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="INDEX/css/main.css"/>
    <link rel="stylesheet" type="text/css" href="INDEX/css/extend.css"/>
    <style>
        .more_history {
            text-align: center;
            padding: 0.5em;
        }
       .mui-switch{
      		width:36px;
        	height:18px;
      }
      header div{
      		top : 30%;
      }
      .mui-switch .mui-switch-handle{
      		width:20px;
        	height:20px;
        left:-4px;
        top: -3px;
      }
      .mui-switch.mui-active:before{
      	top:-3px;
        left:1px;
      }
      .mui-switch.mui-active .mui-switch-handle {
    	-webkit-transform: translate(43px,0);
    	transform: translate(20px,0);
		}
      .mui-switch:before{
      		top:-3px;
        	left:15px;
      }
    </style>
</head>
<body>
<script src="INDEX/js/mui.min.js"></script>
<script src="INDEX/js/jquery-1.8.0.min.js" type="text/javascript" charset="utf-8"></script>
<header class="mui-bar mui-bar-nav">
    <a href="#offCanvasSide" class="right_top"></a>
    <!--<a class="mui-switch "></a>-->
    <div class="mui-switch mui-pull-right {if $think_var=='zh-cn'}mui-active{/if}" id="mySwitch" >
        <div class="mui-switch-handle"></div>
    </div>
    <h1 class="mui-title">{$Think.lang.project_title}</h1>
</header>
<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-slide-in">
    <div id="header">{include file='header'/}</div>
    <div class="mui-inner-wrap">
        <div id="offCanvasContentScroll" class="mui-content mui-scroll-wrapper mui-slide-in">
            <div class="mui-scroll">
                <div class="transfer_content">
                    <div class="transfer_top">
                        <div class="content_table">
                            <div class="total_day">
                                <div class="extend_total">
                                    <div>{$Think.lang.brokerage_all}</div>
                                    <div class="extend_total_num" style="color: #DE2B2F;">${$sysData.all_brokerage}</div>
                                </div>
                                <div class="extend_day">
                                    <div>{$Think.lang.brokerage_day}</div>
                                    <div class="extend_day_num" style="color: #DE2B2F;">{$sysData.day_brokerage}$</div>
                                </div>
                            </div>
                            <div class="month_year">
                                <div class="extend_month">
                                    <div>{$Think.lang.brokerage_month}</div>
                                    <div class="extend_month_num" style="color: #DE2B2F;">${$sysData.month_brokerage}</div>
                                </div>
                                <div class="extend_year">
                                    <div>{$Think.lang.brokerage_year}</div>
                                    <div class="extend_year_num" style="color: #DE2B2F;">${$sysData.year_brokerage}</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="extend_middle" >
                        <div class="cash_history">
                            <div class="cash_history_title">{$Think.lang.brokerage_list_show}</div>
                            <div class="history_table" >
                                <div class="table_box" id="tablescorll">
                                    <table border="" cellspacing="5" cellpadding="5" rules="none" style="width: 100%;" >
                                        <tbody id="tabody">
                                        <tr>
                                            <th >{$Think.lang.member}</th>
                                            <th >{$Think.lang.purchase_identity}</th>
                                            <th >{$Think.lang.brokerage_percent}</th>
                                            <th >{$Think.lang.brokerage_money}</th>
                                            <th >{$Think.lang.give_out_date}</th>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="more_history">{$Think.lang.put_load_more}</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    mui.init()
</script>
<script src="INDEX/js/switchover.js"></script>

<script type="text/javascript">
 mui('#offCanvasSideScroll').scroll();
	mui('#offCanvasContentScroll').scroll();
    var more=document.getElementsByClassName("more_history")[0];
    more.addEventListener("tap", function () {
        pullfreshfunction();
    });
    var pageStart = 1;//开始数据条数
    pullfreshfunction();
    function pullfreshfunction() {
        var __self=this;
        var url = "{:Url('index/get_brokerage')}";
        var page = pageStart;
        var str="";
        mui.ajax({
            type: "post",
            url: url,
            timeout: 10000,
            data: {
                page: page
            },
            dataType: "json",
            success: function (data) {
                if (data.code == 0) {
                    console.log(data.data)
                    var list = data.data;
                    for (i in list) {
                        str+= "<tr>"+
                                "<td>"+list[i].user_name+"</td>"+
                                "<td>"+list[i].name+"</td>"+
                                "<td>"+list[i].percent+"%</td>"+
                                "<td>$"+list[i].money+"</td>"+
                                "<td>"+list[i].create_time+"</td>"+
                                "</tr>";
                    }
                    document.getElementById("tabody").innerHTML+=str;
                    pageStart++;
                }else{
                    mui.toast(data.message);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                console.log("请求失败!!！" + textStatus);
            }
        });

    }
</script>

</html>